Skip to content

Conversation

@ThaisaFujii
Copy link
Contributor

lesson 2

import Foundation
import UIKit

class RioAlertHelper {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

futuramente vou sugerir para usar composição para essa funcao (aula de LI)
mas por enquanto sugiro apenas usar enum ao inves de classe
já que nao tem necessidade de instanciar esse objeto

import Foundation
import UIKit

class RioResetPasswordViewConfigurator {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nao interessante performar operações da viewController fora dela (com exceção do coordinator)
todas as funcoes desse objeto recebem viewController de parâmetro para performar acoes nela
eu sugiro duas opções:

  • deixar tudo na viewController mesmo
  • tirar View da ViewController e fazer ajustes de layout na View (igual mostrado ontem na aula)

recoverPasswordButton.setTitleColor(.white, for: .normal)
recoverPasswordButton.isEnabled = isValid
private func updateRecoverPasswordButtonTitleForSuccess() {
recoverPasswordButton.setTitle("Voltar", for: .normal)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n tem necessidade de uma funcao com 1 linha

try validateEmail(email)
try validateInternetConnection()

service.resetPassword(email: email) { [weak self] success in
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usar async throws na funcao resetPassword da sua service
vai fazer com que essa funcao aqui fique muito mais limpa

Copy link
Owner

@ppedroam ppedroam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code review 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants